<?php
class Category extends CI_Controller {
    function __construct(){
	   parent::__construct();
	   $this->load->library(array('form_validation','session','libsblock'));
	}
    public function index() {
        $left = array('modblogs','modblogs2','modblogs3'); // lay tu DB xem cot left co gi
        
        // Viet mot function xem nguoi dung yeu cau xu ly cai gi, o module nao
        // VD: xu ly tai cac mod co cac yeu cau la param nhu duoi
        // Module blogs3 khong co yeu cau gi thi gui array null
        $param['modblogs'][] = array('param1','param2'); 
        $param['modblogs2'][] = array('param3','param4');
        $param['modblogs3'][] = array('param6');
        foreach($left as $md){
            $module = 'modules/'.$md;
            $data['left'][$md] = $this->load->controller($module,$param[$md],true);
        }
        
        $this->load->view('temp',$data);
    }
   
    function test(){
        // Truoc khi xu ly can phan tich nguoi dung yeu cau gi, tai module nao
        $param['modblogs']= array('param1','param2'); // Luu yeu cau tu nguoi dung
        $this->load->controller('modules/modblogs',$param); // Gui du lieu den controller thuc hien yeu cau
    }
}
?>